<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/static/css/shoppingcart.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/static/css/cart.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/static/css/login.css">
</head>
<body style="text-align: left;">
<%@ include file="head.jsp" %>
<!-- 面包屑导航 -->
<div class="nav_bar">
    <div class="wrap">
        <a href="index.html">首页</a>&gt;
        <a href="#">我的购物车</a>
    </div>
</div>
<!-- 购物车商品主体 -->
<div class="wrap">

    <div class="cart_list">
        <!--购物车表单-->
        <form id="cartForm" method="post" action="#">
            <table cellpadding="0" cellspacing="0">
                <thead>
                <tr>
                    <td class="state"><span class="all_checkbox"><span class="checkbox"><label class="curr"></label></span><label>全选</label></span></td>
                    <td class="name">商品名称</td>
                    <td class="num">数量</td>
                    <td class="prices">价格</td>
                    <td class="operation">操作</td>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${cart }" var="cart">
                    <tr data-pid="${cart.id}" >
                        <input type="hidden" value="${cart.id}" id="hidenpid"/>
                        <td class="state">
                                    <span class="checkbox">
                                        <input type="checkbox" style="display:block" class="curr" name="pids" value="${cart.kuid }" checked="checked">
                                        <!--                                     <label class="curr" data-pid="522"></label> -->
                                    </span>
                        </td>
                        <td>
                            <dl class="cf">
                                <dt class="f_left"><a href="#" target="_blank"><img src="${cart.product.imgurl }" alt="" title="DOTA2-2018年国际邀请赛 主题马克杯"></a></dt>
                                <dd class="f_left">
                                    <h1 class="cf">
                                        <a href="#" class="name ellipsis2" target="_blank" title="DOTA2-2018年国际邀请赛 主题马克杯">${cart.product.pname }</a>
                                    </h1>

                                </dd>
                            </dl>
                        </td>
                        <td>
                            <input id="price_522" type="hidden" value="11800">
                            <span class="amount number-input"><span class="reduce disable"></span><input id="buyNumber" data-pid="${cart.id}" type="text" value="${cart.num }" min="1" data-stock="45" data-suit-number="1" maxlength="3" autocomplete="off"><span class="plus"></span></span>
                            <p class="stock">库存<font id="stock_num">${cart.productKuid.storenum}</font>件</p>
                        </td>
                        <td class="price">¥<font id="rmbPrice_522">${cart.product.price }</font></td>
                        <td><a href="${pageContext.request.contextPath}/deleteCar" class="del" data-pid="522"><span></span></a></td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
            <div class="cf total_bar">
                <p class="f_left">
                    <span class="all_checkbox"><span class="checkbox"><label class="curr"></label></span><label>全选</label></span>
                    <a href="${pageContext.request.contextPath}/deleteCar" class="batch-delete">删除选中商品</a>
                    <a href="${pageContext.request.contextPath}/productListView">继续购物</a>
                </p>
                <div class="f_right">
                    <div class="f_right">
                        <input type="button" value="去结算" class="btn btn_checkout" id="shopOrder" >
                        <p class="tip tip_checkout" style="display: none;"></p>
                    </div>
                    <p class="f_right">共<span id="num"><font id="checkoutNum">2</font></span>件商品，　合计：<span>¥<font id="checkoutPrice">15800</font></span></p>
                </div>
            </div>
        </form>
    </div>

    <!-- 猜你喜欢 && 我的关注 -->
    <div class="likes">
        <div class="nav">
            <ul class="cf">
                <li class="on">猜你喜欢</li>

            </ul>
        </div>
        <div class="tempWrap" style="overflow:hidden; position:relative; width:1190px"><div class="content" style="width: 1190px; position: relative; overflow: hidden; padding: 0px; margin: 0px; left: 0px;">
            <div class="like" style="float: left; width: 1190px;">
                <div class="bd">
                    <div class="tempWrap" style="overflow:hidden; position:relative; width:1080px"><div class="list" style="width: 2160px; position: relative; overflow: hidden; padding: 0px; margin: 0px; left: 0px;">
                        <ul class="cf" style="float: left; width: 1080px;">
                        </ul>
                    </div></div>
                    <a class="prev" href="javascript:void(0)"><span></span></a>
                    <a class="next" href="javascript:void(0)"><span></span></a>
                </div>
            </div>

        </div></div>
    </div>
</div>
<%@ include file="footer.jsp" %>
<script type="text/javascript">
    $(function () {
        $("#shopOrder").click(function () {
            var pid=$("#hidenpid").val();
            window.location.href="${pageContext.request.contextPath}/order/orderview?pids="+pid;
        })

    })


</script>
</body>
</html>
